Skip to content

Find PR base branch without GitHub API and enable test skipping #9080

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Jul 9, 2025

Conversation

smola
Copy link
Member

@smola smola commented Jul 2, 2025

What Does This Do

  • Find base branch for a PR based on pure git heuristics.
  • We consider base branch whatever master or release/v.* has a merge base closest to the current HEAD.
  • In some cases, there may be ambiguity, for example, shortly after cutting a release branch, or for the first PR to a release branch. In these cases, if there is more than 1 base branch candidate (same distance to merge base), we bail out and assume nothing. In that case, we will not skip any test.
  • This will not work accurately for stacked PRs, but falls on the safe side: these will have less skipped tests than necessary.

Motivation

Skipping tests based on git changes introduced in #9039 had to be reverted at #9078 because it did hit GitHub API rate limits.

Additional Notes

Contributor Checklist

Jira ticket: [PROJ-IDENT]

@smola smola added tag: no release notes Changes to exclude from release notes comp: tooling Build & Tooling tag: do not merge Do not merge changes labels Jul 2, 2025
@smola smola marked this pull request as ready for review July 2, 2025 07:39
@smola smola requested a review from a team as a code owner July 2, 2025 07:39
@smola smola requested review from randomanderson and removed request for a team July 2, 2025 07:39
@smola smola changed the title Find PR base branch without GitHub API Find PR base branch without GitHub API and enable test skipping Jul 2, 2025
@pr-commenter
Copy link

pr-commenter bot commented Jul 2, 2025

Benchmarks

Startup

Parameters

Baseline Candidate
baseline_or_candidate baseline candidate
git_branch master smola/git-skip-no-gh
git_commit_date 1752048042 1752048528
git_commit_sha 16eee52 0ca758d
release_version 1.51.0-SNAPSHOT~16eee52b4d 1.51.0-SNAPSHOT~0ca758d26b
See matching parameters
Baseline Candidate
application insecure-bank insecure-bank
ci_job_date 1752050329 1752050329
ci_job_id 1020007296 1020007296
ci_pipeline_id 70011785 70011785
cpu_model Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz
kernel_version Linux runner-zfyrx7zua-project-304-concurrent-0-myj6rph0 6.8.0-1031-aws #33~22.04.1-Ubuntu SMP Thu Jun 26 14:22:30 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux Linux runner-zfyrx7zua-project-304-concurrent-0-myj6rph0 6.8.0-1031-aws #33~22.04.1-Ubuntu SMP Thu Jun 26 14:22:30 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux
module Agent Agent
parent None None

Summary

Found 0 performance improvements and 0 performance regressions! Performance is the same for 44 metrics, 9 unstable metrics.

Startup time reports for insecure-bank
gantt
    title insecure-bank - global startup overhead: candidate=1.51.0-SNAPSHOT~0ca758d26b, baseline=1.51.0-SNAPSHOT~16eee52b4d

    dateFormat X
    axisFormat %s
section tracing
Agent [baseline] (998.583 ms) : 0, 998583
Total [baseline] (8.575 s) : 0, 8574880
Agent [candidate] (995.008 ms) : 0, 995008
Total [candidate] (8.567 s) : 0, 8566889
section iast
Agent [baseline] (1.131 s) : 0, 1131386
Total [baseline] (9.278 s) : 0, 9278002
Agent [candidate] (1.131 s) : 0, 1131070
Total [candidate] (9.301 s) : 0, 9301017
Loading
  • baseline results
Module Variant Duration Δ tracing
Agent tracing 998.583 ms -
Agent iast 1.131 s 132.802 ms (13.3%)
Total tracing 8.575 s -
Total iast 9.278 s 703.121 ms (8.2%)
  • candidate results
Module Variant Duration Δ tracing
Agent tracing 995.008 ms -
Agent iast 1.131 s 136.062 ms (13.7%)
Total tracing 8.567 s -
Total iast 9.301 s 734.129 ms (8.6%)
gantt
    title insecure-bank - break down per module: candidate=1.51.0-SNAPSHOT~0ca758d26b, baseline=1.51.0-SNAPSHOT~16eee52b4d

    dateFormat X
    axisFormat %s
section tracing
BytebuddyAgent [baseline] (690.011 ms) : 0, 690011
BytebuddyAgent [candidate] (686.824 ms) : 0, 686824
GlobalTracer [baseline] (242.42 ms) : 0, 242420
GlobalTracer [candidate] (242.06 ms) : 0, 242060
AppSec [baseline] (30.35 ms) : 0, 30350
AppSec [candidate] (30.427 ms) : 0, 30427
Debugger [baseline] (6.086 ms) : 0, 6086
Debugger [candidate] (6.073 ms) : 0, 6073
Remote Config [baseline] (675.294 µs) : 0, 675
Remote Config [candidate] (675.814 µs) : 0, 676
Telemetry [baseline] (8.324 ms) : 0, 8324
Telemetry [candidate] (8.222 ms) : 0, 8222
section iast
BytebuddyAgent [baseline] (807.328 ms) : 0, 807328
BytebuddyAgent [candidate] (806.671 ms) : 0, 806671
GlobalTracer [baseline] (231.741 ms) : 0, 231741
GlobalTracer [candidate] (231.846 ms) : 0, 231846
IAST [baseline] (28.655 ms) : 0, 28655
IAST [candidate] (28.731 ms) : 0, 28731
AppSec [baseline] (27.802 ms) : 0, 27802
AppSec [candidate] (27.03 ms) : 0, 27030
Debugger [baseline] (6.771 ms) : 0, 6771
Debugger [candidate] (7.589 ms) : 0, 7589
Remote Config [baseline] (582.961 µs) : 0, 583
Remote Config [candidate] (592.374 µs) : 0, 592
Telemetry [baseline] (7.913 ms) : 0, 7913
Telemetry [candidate] (8.027 ms) : 0, 8027
Loading
Startup time reports for petclinic
gantt
    title petclinic - global startup overhead: candidate=1.51.0-SNAPSHOT~0ca758d26b, baseline=1.51.0-SNAPSHOT~16eee52b4d

    dateFormat X
    axisFormat %s
section tracing
Agent [baseline] (999.069 ms) : 0, 999069
Total [baseline] (10.701 s) : 0, 10701457
Agent [candidate] (1.001 s) : 0, 1001160
Total [candidate] (10.629 s) : 0, 10629377
section appsec
Agent [baseline] (1.179 s) : 0, 1179472
Total [baseline] (10.753 s) : 0, 10753434
Agent [candidate] (1.173 s) : 0, 1172788
Total [candidate] (10.762 s) : 0, 10761734
section iast
Agent [baseline] (1.141 s) : 0, 1140791
Total [baseline] (10.862 s) : 0, 10862074
Agent [candidate] (1.13 s) : 0, 1130217
Total [candidate] (10.812 s) : 0, 10812474
section profiling
Agent [baseline] (1.25 s) : 0, 1250451
Total [baseline] (10.99 s) : 0, 10989661
Agent [candidate] (1.245 s) : 0, 1244823
Total [candidate] (10.961 s) : 0, 10961304
Loading
  • baseline results
Module Variant Duration Δ tracing
Agent tracing 999.069 ms -
Agent appsec 1.179 s 180.403 ms (18.1%)
Agent iast 1.141 s 141.722 ms (14.2%)
Agent profiling 1.25 s 251.381 ms (25.2%)
Total tracing 10.701 s -
Total appsec 10.753 s 51.977 ms (0.5%)
Total iast 10.862 s 160.617 ms (1.5%)
Total profiling 10.99 s 288.204 ms (2.7%)
  • candidate results
Module Variant Duration Δ tracing
Agent tracing 1.001 s -
Agent appsec 1.173 s 171.629 ms (17.1%)
Agent iast 1.13 s 129.057 ms (12.9%)
Agent profiling 1.245 s 243.663 ms (24.3%)
Total tracing 10.629 s -
Total appsec 10.762 s 132.357 ms (1.2%)
Total iast 10.812 s 183.097 ms (1.7%)
Total profiling 10.961 s 331.927 ms (3.1%)
gantt
    title petclinic - break down per module: candidate=1.51.0-SNAPSHOT~0ca758d26b, baseline=1.51.0-SNAPSHOT~16eee52b4d

    dateFormat X
    axisFormat %s
section tracing
BytebuddyAgent [baseline] (690.906 ms) : 0, 690906
BytebuddyAgent [candidate] (692.391 ms) : 0, 692391
GlobalTracer [baseline] (242.251 ms) : 0, 242251
GlobalTracer [candidate] (242.706 ms) : 0, 242706
AppSec [baseline] (30.132 ms) : 0, 30132
AppSec [candidate] (30.184 ms) : 0, 30184
Debugger [baseline] (6.067 ms) : 0, 6067
Debugger [candidate] (6.128 ms) : 0, 6128
Remote Config [baseline] (676.199 µs) : 0, 676
Remote Config [candidate] (676.234 µs) : 0, 676
Telemetry [baseline] (8.188 ms) : 0, 8188
Telemetry [candidate] (8.203 ms) : 0, 8203
section appsec
BytebuddyAgent [baseline] (713.757 ms) : 0, 713757
BytebuddyAgent [candidate] (709.088 ms) : 0, 709088
GlobalTracer [baseline] (236.079 ms) : 0, 236079
GlobalTracer [candidate] (234.757 ms) : 0, 234757
AppSec [baseline] (171.033 ms) : 0, 171033
AppSec [candidate] (170.799 ms) : 0, 170799
Debugger [baseline] (5.708 ms) : 0, 5708
Debugger [candidate] (5.711 ms) : 0, 5711
Remote Config [baseline] (606.855 µs) : 0, 607
Remote Config [candidate] (593.423 µs) : 0, 593
Telemetry [baseline] (8.007 ms) : 0, 8007
Telemetry [candidate] (7.955 ms) : 0, 7955
IAST [baseline] (23.371 ms) : 0, 23371
IAST [candidate] (23.106 ms) : 0, 23106
section iast
BytebuddyAgent [baseline] (813.787 ms) : 0, 813787
BytebuddyAgent [candidate] (805.695 ms) : 0, 805695
GlobalTracer [baseline] (233.762 ms) : 0, 233762
GlobalTracer [candidate] (231.762 ms) : 0, 231762
AppSec [baseline] (30.004 ms) : 0, 30004
AppSec [candidate] (30.722 ms) : 0, 30722
Debugger [baseline] (6.717 ms) : 0, 6717
Debugger [candidate] (5.825 ms) : 0, 5825
Remote Config [baseline] (585.211 µs) : 0, 585
Remote Config [candidate] (574.313 µs) : 0, 574
Telemetry [baseline] (7.951 ms) : 0, 7951
Telemetry [candidate] (7.972 ms) : 0, 7972
IAST [baseline] (27.174 ms) : 0, 27174
IAST [candidate] (26.968 ms) : 0, 26968
section profiling
ProfilingAgent [baseline] (103.974 ms) : 0, 103974
ProfilingAgent [candidate] (104.11 ms) : 0, 104110
BytebuddyAgent [baseline] (682.066 ms) : 0, 682066
BytebuddyAgent [candidate] (678.22 ms) : 0, 678220
GlobalTracer [baseline] (362.242 ms) : 0, 362242
GlobalTracer [candidate] (360.89 ms) : 0, 360890
AppSec [baseline] (33.241 ms) : 0, 33241
AppSec [candidate] (33.829 ms) : 0, 33829
Debugger [baseline] (11.434 ms) : 0, 11434
Debugger [candidate] (10.65 ms) : 0, 10650
Remote Config [baseline] (651.841 µs) : 0, 652
Remote Config [candidate] (661.282 µs) : 0, 661
Telemetry [baseline] (7.942 ms) : 0, 7942
Telemetry [candidate] (7.988 ms) : 0, 7988
Profiling [baseline] (103.999 ms) : 0, 103999
Profiling [candidate] (104.138 ms) : 0, 104138
Loading

Load

Parameters

Baseline Candidate
baseline_or_candidate baseline candidate
git_branch master smola/git-skip-no-gh
git_commit_date 1752048042 1752048528
git_commit_sha 16eee52 0ca758d
release_version 1.51.0-SNAPSHOT~16eee52b4d 1.51.0-SNAPSHOT~0ca758d26b
See matching parameters
Baseline Candidate
application insecure-bank insecure-bank
ci_job_date 1752050019 1752050019
ci_job_id 1020007297 1020007297
ci_pipeline_id 70011785 70011785
cpu_model Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz
kernel_version Linux runner-zfyrx7zua-project-304-concurrent-1-ngxg0xnx 6.8.0-1031-aws #33~22.04.1-Ubuntu SMP Thu Jun 26 14:22:30 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux Linux runner-zfyrx7zua-project-304-concurrent-1-ngxg0xnx 6.8.0-1031-aws #33~22.04.1-Ubuntu SMP Thu Jun 26 14:22:30 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux

Summary

Found 2 performance improvements and 0 performance regressions! Performance is the same for 10 metrics, 12 unstable metrics.

scenario Δ mean http_req_duration Δ mean throughput candidate mean http_req_duration candidate mean throughput baseline mean http_req_duration baseline mean throughput
scenario:load:petclinic:appsec:high_load better
[-2.032ms; -1.102ms] or [-4.232%; -2.295%]
unstable
[-3.930op/s; +10.455op/s] or [-4.031%; +10.723%]
46.449ms 100.763op/s 48.016ms 97.500op/s
scenario:load:petclinic:profiling:high_load better
[-2.376ms; -1.441ms] or [-4.945%; -3.000%]
unstable
[-3.279op/s; +11.254op/s] or [-3.366%; +11.554%]
46.146ms 101.388op/s 48.055ms 97.400op/s
Request duration reports for insecure-bank
gantt
    title insecure-bank - request duration [CI 0.99] : candidate=1.51.0-SNAPSHOT~0ca758d26b, baseline=1.51.0-SNAPSHOT~16eee52b4d
    dateFormat X
    axisFormat %s
section baseline
no_agent (4.485 ms) : 4431, 4540
.   : milestone, 4485,
iast (9.25 ms) : 9095, 9405
.   : milestone, 9250,
iast_FULL (13.811 ms) : 13538, 14083
.   : milestone, 13811,
iast_GLOBAL (10.387 ms) : 10202, 10571
.   : milestone, 10387,
profiling (8.852 ms) : 8716, 8988
.   : milestone, 8852,
tracing (7.824 ms) : 7709, 7940
.   : milestone, 7824,
section candidate
no_agent (4.439 ms) : 4390, 4489
.   : milestone, 4439,
iast (9.532 ms) : 9376, 9689
.   : milestone, 9532,
iast_FULL (13.908 ms) : 13631, 14185
.   : milestone, 13908,
iast_GLOBAL (10.569 ms) : 10379, 10759
.   : milestone, 10569,
profiling (8.817 ms) : 8670, 8965
.   : milestone, 8817,
tracing (7.648 ms) : 7531, 7765
.   : milestone, 7648,
Loading
  • baseline results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 4.485 ms [4.431 ms, 4.54 ms] -
iast 9.25 ms [9.095 ms, 9.405 ms] 4.765 ms (106.2%)
iast_FULL 13.811 ms [13.538 ms, 14.083 ms] 9.325 ms (207.9%)
iast_GLOBAL 10.387 ms [10.202 ms, 10.571 ms] 5.901 ms (131.6%)
profiling 8.852 ms [8.716 ms, 8.988 ms] 4.367 ms (97.4%)
tracing 7.824 ms [7.709 ms, 7.94 ms] 3.339 ms (74.4%)
  • candidate results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 4.439 ms [4.39 ms, 4.489 ms] -
iast 9.532 ms [9.376 ms, 9.689 ms] 5.093 ms (114.7%)
iast_FULL 13.908 ms [13.631 ms, 14.185 ms] 9.469 ms (213.3%)
iast_GLOBAL 10.569 ms [10.379 ms, 10.759 ms] 6.13 ms (138.1%)
profiling 8.817 ms [8.67 ms, 8.965 ms] 4.378 ms (98.6%)
tracing 7.648 ms [7.531 ms, 7.765 ms] 3.209 ms (72.3%)
Request duration reports for petclinic
gantt
    title petclinic - request duration [CI 0.99] : candidate=1.51.0-SNAPSHOT~0ca758d26b, baseline=1.51.0-SNAPSHOT~16eee52b4d
    dateFormat X
    axisFormat %s
section baseline
no_agent (37.531 ms) : 37226, 37836
.   : milestone, 37531,
appsec (48.016 ms) : 47572, 48459
.   : milestone, 48016,
code_origins (45.768 ms) : 45357, 46180
.   : milestone, 45768,
iast (44.097 ms) : 43713, 44482
.   : milestone, 44097,
profiling (48.055 ms) : 47622, 48489
.   : milestone, 48055,
tracing (44.985 ms) : 44605, 45365
.   : milestone, 44985,
section candidate
no_agent (37.488 ms) : 37176, 37800
.   : milestone, 37488,
appsec (46.449 ms) : 46028, 46869
.   : milestone, 46449,
code_origins (45.388 ms) : 44983, 45793
.   : milestone, 45388,
iast (44.795 ms) : 44389, 45202
.   : milestone, 44795,
profiling (46.146 ms) : 45711, 46581
.   : milestone, 46146,
tracing (45.813 ms) : 45411, 46214
.   : milestone, 45813,
Loading
  • baseline results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 37.531 ms [37.226 ms, 37.836 ms] -
appsec 48.016 ms [47.572 ms, 48.459 ms] 10.484 ms (27.9%)
code_origins 45.768 ms [45.357 ms, 46.18 ms] 8.237 ms (21.9%)
iast 44.097 ms [43.713 ms, 44.482 ms] 6.566 ms (17.5%)
profiling 48.055 ms [47.622 ms, 48.489 ms] 10.524 ms (28.0%)
tracing 44.985 ms [44.605 ms, 45.365 ms] 7.454 ms (19.9%)
  • candidate results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 37.488 ms [37.176 ms, 37.8 ms] -
appsec 46.449 ms [46.028 ms, 46.869 ms] 8.961 ms (23.9%)
code_origins 45.388 ms [44.983 ms, 45.793 ms] 7.9 ms (21.1%)
iast 44.795 ms [44.389 ms, 45.202 ms] 7.307 ms (19.5%)
profiling 46.146 ms [45.711 ms, 46.581 ms] 8.658 ms (23.1%)
tracing 45.813 ms [45.411 ms, 46.214 ms] 8.325 ms (22.2%)

Dacapo

Parameters

Baseline Candidate
baseline_or_candidate baseline candidate
git_branch master smola/git-skip-no-gh
git_commit_date 1752048042 1752048528
git_commit_sha 16eee52 0ca758d
release_version 1.51.0-SNAPSHOT~16eee52b4d 1.51.0-SNAPSHOT~0ca758d26b
See matching parameters
Baseline Candidate
application biojava biojava
ci_job_date 1752050529 1752050529
ci_job_id 1020007298 1020007298
ci_pipeline_id 70011785 70011785
cpu_model Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz
kernel_version Linux runner-zfyrx7zua-project-304-concurrent-0-c1hwvaiv 6.8.0-1031-aws #33~22.04.1-Ubuntu SMP Thu Jun 26 14:22:30 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux Linux runner-zfyrx7zua-project-304-concurrent-0-c1hwvaiv 6.8.0-1031-aws #33~22.04.1-Ubuntu SMP Thu Jun 26 14:22:30 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux

Summary

Found 0 performance improvements and 0 performance regressions! Performance is the same for 12 metrics, 0 unstable metrics.

Execution time for tomcat
gantt
    title tomcat - execution time [CI 0.99] : candidate=1.51.0-SNAPSHOT~0ca758d26b, baseline=1.51.0-SNAPSHOT~16eee52b4d
    dateFormat X
    axisFormat %s
section baseline
no_agent (1.482 ms) : 1471, 1494
.   : milestone, 1482,
appsec (2.417 ms) : 2367, 2466
.   : milestone, 2417,
iast (2.217 ms) : 2154, 2280
.   : milestone, 2217,
iast_GLOBAL (2.254 ms) : 2191, 2317
.   : milestone, 2254,
profiling (2.051 ms) : 2000, 2103
.   : milestone, 2051,
tracing (2.031 ms) : 1983, 2080
.   : milestone, 2031,
section candidate
no_agent (1.483 ms) : 1472, 1495
.   : milestone, 1483,
appsec (2.426 ms) : 2376, 2476
.   : milestone, 2426,
iast (2.213 ms) : 2150, 2276
.   : milestone, 2213,
iast_GLOBAL (2.268 ms) : 2205, 2331
.   : milestone, 2268,
profiling (2.068 ms) : 2017, 2120
.   : milestone, 2068,
tracing (2.033 ms) : 1984, 2082
.   : milestone, 2033,
Loading
  • baseline results
Variant Execution Time [CI 0.99] Δ no_agent
no_agent 1.482 ms [1.471 ms, 1.494 ms] -
appsec 2.417 ms [2.367 ms, 2.466 ms] 934.481 µs (63.1%)
iast 2.217 ms [2.154 ms, 2.28 ms] 734.916 µs (49.6%)
iast_GLOBAL 2.254 ms [2.191 ms, 2.317 ms] 772.03 µs (52.1%)
profiling 2.051 ms [2.0 ms, 2.103 ms] 569.163 µs (38.4%)
tracing 2.031 ms [1.983 ms, 2.08 ms] 549.382 µs (37.1%)
  • candidate results
Variant Execution Time [CI 0.99] Δ no_agent
no_agent 1.483 ms [1.472 ms, 1.495 ms] -
appsec 2.426 ms [2.376 ms, 2.476 ms] 943.125 µs (63.6%)
iast 2.213 ms [2.15 ms, 2.276 ms] 729.973 µs (49.2%)
iast_GLOBAL 2.268 ms [2.205 ms, 2.331 ms] 784.642 µs (52.9%)
profiling 2.068 ms [2.017 ms, 2.12 ms] 585.16 µs (39.5%)
tracing 2.033 ms [1.984 ms, 2.082 ms] 549.509 µs (37.0%)
Execution time for biojava
gantt
    title biojava - execution time [CI 0.99] : candidate=1.51.0-SNAPSHOT~0ca758d26b, baseline=1.51.0-SNAPSHOT~16eee52b4d
    dateFormat X
    axisFormat %s
section baseline
no_agent (14.774 s) : 14774000, 14774000
.   : milestone, 14774000,
appsec (14.777 s) : 14777000, 14777000
.   : milestone, 14777000,
iast (18.791 s) : 18791000, 18791000
.   : milestone, 18791000,
iast_GLOBAL (17.98 s) : 17980000, 17980000
.   : milestone, 17980000,
profiling (15.711 s) : 15711000, 15711000
.   : milestone, 15711000,
tracing (14.974 s) : 14974000, 14974000
.   : milestone, 14974000,
section candidate
no_agent (15.476 s) : 15476000, 15476000
.   : milestone, 15476000,
appsec (14.833 s) : 14833000, 14833000
.   : milestone, 14833000,
iast (18.356 s) : 18356000, 18356000
.   : milestone, 18356000,
iast_GLOBAL (18.212 s) : 18212000, 18212000
.   : milestone, 18212000,
profiling (15.098 s) : 15098000, 15098000
.   : milestone, 15098000,
tracing (14.596 s) : 14596000, 14596000
.   : milestone, 14596000,
Loading
  • baseline results
Variant Execution Time [CI 0.99] Δ no_agent
no_agent 14.774 s [14.774 s, 14.774 s] -
appsec 14.777 s [14.777 s, 14.777 s] 3.0 ms (0.0%)
iast 18.791 s [18.791 s, 18.791 s] 4.017 s (27.2%)
iast_GLOBAL 17.98 s [17.98 s, 17.98 s] 3.206 s (21.7%)
profiling 15.711 s [15.711 s, 15.711 s] 937.0 ms (6.3%)
tracing 14.974 s [14.974 s, 14.974 s] 200.0 ms (1.4%)
  • candidate results
Variant Execution Time [CI 0.99] Δ no_agent
no_agent 15.476 s [15.476 s, 15.476 s] -
appsec 14.833 s [14.833 s, 14.833 s] -643.0 ms (-4.2%)
iast 18.356 s [18.356 s, 18.356 s] 2.88 s (18.6%)
iast_GLOBAL 18.212 s [18.212 s, 18.212 s] 2.736 s (17.7%)
profiling 15.098 s [15.098 s, 15.098 s] -378.0 ms (-2.4%)
tracing 14.596 s [14.596 s, 14.596 s] -880.0 ms (-5.7%)

@smola smola requested review from a team and PerfectSlayer July 7, 2025 07:18
@smola smola removed the tag: do not merge Do not merge changes label Jul 7, 2025
@PerfectSlayer PerfectSlayer requested a review from Copilot July 9, 2025 04:45
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Introduces a pure-git heuristic to detect a PR’s base branch and re-enables test-skipping in CI without hitting GitHub API limits.

  • Replaces GitHub API calls in .gitlab/find-gh-base-ref.sh with a merge-base distance heuristic
  • Enables the new base-ref detection in CI by updating .gitlab-ci.yml
  • Bails out when multiple branches share the same distance to avoid incorrect assumptions

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
.gitlab/find-gh-base-ref.sh Removed API/token logic, added get_distance_from_merge_base and candidate loop
.gitlab-ci.yml Re-enabled the base-ref check by removing the false && guard
Comments suppressed due to low confidence (2)

.gitlab-ci.yml:122

  • [nitpick] Ensure this line’s indentation aligns correctly under the - | block in the YAML to prevent parsing or execution errors after removing the commented guard.
    if [[ ! $CI_COMMIT_BRANCH =~ ^(master|release/.*)$ ]]; then

.gitlab/find-gh-base-ref.sh:51

  • Add unit or integration tests for the base-ref selection logic, covering both unique and ambiguous candidate scenarios to prevent regressions.
# Find the best base ref: the master/release branch whose merge base is closest to HEAD.

Copy link
Contributor

@PerfectSlayer PerfectSlayer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor comments.

Stacked PR aren't used a lot. It should be fine to use not support this optimization for them. But in the same time, I wonder if we can find the recent branches from the committer and add them to the candidates. Would that work?

EDIT: I added Copilot as a review to check what kind of feedback it can provide on bash scripting. Not like I did not want to review your PR myself 😉

# NOTE: GitHub API is more robust for this task, but we hit rate limits.
BEST_CANDIDATES=(origin/master)
BEST_DISTANCE=$(get_distance_from_merge_base origin/master)
mapfile -t CANDIDATE_BASES < <(git branch -a --sort=committerdate --format='%(refname:short)' --list 'origin/release/v*' | tac)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we add /project/* branches?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. Only added them if the current branch is not already a project branch. To avoid messing up when the project branch is being merged to master.

@smola smola force-pushed the smola/git-skip-no-gh branch from bd541eb to a4c9d0b Compare July 9, 2025 07:48
else
echo "Failed to find base ref for PR" >&2
fi
export GIT_BASE_REF=$(.gitlab/find-gh-base-ref.sh)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also moved some logic here to the script. If it's master or release, it will produce no base ref. If CI_COMMIT_BRANCH is not defined, it will also skip.

Copy link
Contributor

@PerfectSlayer PerfectSlayer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Let's try it in CI

@smola
Copy link
Member Author

smola commented Jul 9, 2025

@PerfectSlayer Thanks. Thinking of what could possibly go wrong, I realized I have to test this does the right thing (skipping the logic) if we're on a git tag.

@smola
Copy link
Member Author

smola commented Jul 9, 2025

Ok. In tag pipelines, CI_COMMIT_BRANCH will not be defined (docs). In that case, we just skip base ref resolving.

@smola smola merged commit 4acd1c7 into master Jul 9, 2025
507 checks passed
@smola smola deleted the smola/git-skip-no-gh branch July 9, 2025 10:51
@github-actions github-actions bot added this to the 1.51.0 milestone Jul 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
comp: tooling Build & Tooling tag: no release notes Changes to exclude from release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants